﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.IO;
using System.Configuration;
using LyncServerExtension.Monitoring;

namespace LyncServerExtension.WebService
{
    /// <summary>
    /// Class to represent the HTTP web service.
    /// It regroups the different parameters.
    /// </summary>
    public sealed class LyncService : LyncWebService
    {
        private static readonly string DOMAIN_NAME = ConfigurationManager.AppSettings["DomainName"];
        private static readonly string SERVER_NAME = ConfigurationManager.AppSettings["ServerName"];
        private static readonly string SEFAUTIL_PATH = ConfigurationManager.AppSettings["SEFAUtilPath"];
        private static readonly string WORKING_DIRECTORY_PATH = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
        private static readonly string PLUGIN_DIRECTORY_PATH = Path.Combine(WORKING_DIRECTORY_PATH, "Plugins");
        private static readonly string DELEGATION_POLICY_FILE_PATH = Path.Combine(WORKING_DIRECTORY_PATH, "DelegationPolicy.xml");
        private static readonly string LOG_DIRECTORY_PATH = Path.Combine(WORKING_DIRECTORY_PATH, "Logs");

        /// <summary>
        /// Initializes a new instance of the <see cref="LyncService"/> class.
        /// </summary>
        public LyncService()
            : base(DOMAIN_NAME, SERVER_NAME, SEFAUTIL_PATH, PLUGIN_DIRECTORY_PATH, DELEGATION_POLICY_FILE_PATH, LOG_DIRECTORY_PATH)
        {
        }
    }
}
